"""
常用的类型提示

# 其他说明

代码 `from datetime import date as date` 中，别名和原名一致，原名和别名用 Ctrl + 鼠标左键单击的跳转不同：
    - 原名：跳转到 datetime 模块的 date 类（用于快速定位源码）
    - 别名：跳转到 date 引用的地方（用于查看哪些地方引用到了）
"""

# flake8: noqa

from datetime import (
    date as date,
    datetime as datetime,
    time as time,
    timedelta as timedelta,
    timezone as timezone,
)
from decimal import Decimal as Decimal
from io import BytesIO as BytesIO
from pathlib import Path as Path
from types import GenericAlias as GenericAlias  # Need: Python version >= 3.9
from typing import (
    Any as Any,
    AsyncGenerator as AsyncGenerator,
    Awaitable as Awaitable,
    Callable as Callable,
    cast as cast,
    ClassVar as ClassVar,
    Coroutine as Coroutine,
    Final as Final,
    # _GenericAlias as GenericAlias,  # noqa: ignore attribute
    FrozenSet as FrozenSet,
    Generator as Generator,
    Generic as Generic,
    Iterable as Iterable,
    Iterator as Iterator,
    Literal as Literal,
    Mapping as Mapping,
    NamedTuple as NamedTuple,
    OrderedDict as OrderedDict,
    overload as overload,
    Self as Self,
    Sequence as Sequence,
    TypedDict as TypedDict,
    TypeVar as TypeVar,
    final as final,
)

T = TypeVar("T")
""" 泛型类型 | 泛型参数 """

CallableNone = Callable[..., None]
""" 可调用对象 | 参数是任意类型，返回值都是 None """

CallableAny = Callable[..., Any]
""" 可调用对象 | 参数和返回值都是任意类型 """

DictIntStr = dict[int, str]
""" 字典 | 键是数字，值是字符串 """

DictIntInt = dict[int, int]
""" 字典 | 键是数字，值是数字 """

DictStrInt = dict[str, int]
""" 字典 | 键是字符串，值是数字 """

DictStrStr = dict[str, str]
""" 字典 | 键值都是字符串 """

DictStrAny = dict[str, Any]
""" 字典 | 键是字符串，值是任意类型 """

ListStr = list[str]
""" 列表 | 元素都是字符串 """

ListInt = list[int]
""" 列表 | 元素都是数字 """

ListDict = list[dict]
""" 列表 | 元素都是字典 """

ListType = list[type]
""" 列表 | 元素都是类型 """

ListBytes = list[bytes]
""" 列表 | 元素都是字节 """

SetStr = set[str]
""" 集合 | 元素都是字符串 """

SetInt = set[int]
""" 集合 | 元素都是数字 """

TupleStr = tuple[str, ...]
""" 元组 | 元素都是字符串 """

TupleInt = tuple[int, ...]
""" 元组 | 元素都是数字 """

TupleDict = tuple[dict, ...]
""" 元组 | 元素都是字典 """

TupleType = tuple[type, ...]
""" 元组 | 元素都是类型 """

StrOrNone = str | None
""" 字符串 或 None """

IntOrNone = int | None
""" 数字 或 None """

IntOrStr = int | str
""" 数字 或 字符串 """

FloatOrNone = float | None
""" 浮点数 或 None """

BoolOrNone = bool | None
""" 布尔值 或 None """

AnyOrNone = Any | None
""" 任意类型 或 None """

DictOrNone = dict | None
""" 字典 或 None """

ListOrNone = list | None
""" 列表 或 None """

SetOrNone = set | None
""" 集合 或 None """

TupleOrNone = tuple | None
""" 元组 或 None """

DateTimeOrNone = datetime | None
""" 日期时间 或 None """

DateOrNone = date | None
""" 日期 或 None """

TimeOrNone = time | None
""" 时间 或 None """

DateTimeOrStr = datetime | str
""" 日期时间 或 字符串 """

DateOrStr = date | str
""" 日期 或 字符串 """

TimeOrStr = time | str
""" 时间 或 字符串 """

DatetimeRelatedType = datetime | date | time
""" 日期时间/日期/时间 """

StrOrBytesIO = str | BytesIO
""" 字符串 或 BytesIO """

NumberType = Decimal | float | int
""" 数字类型 | Decimal, float, int """

PathOrStr = Path | str
""" 路径 或 字符串 """
